package com.tenghu.core.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.tenghu.core.dao.ISqlEmpDao;
import com.tenghu.sql.model.Emp;

@Repository
public class SqlmpDaoImpl implements ISqlEmpDao{
	
	@Autowired
	@Qualifier("sqlserverSessionFactory")
	private SessionFactory sqlserverSessionFactory;

	@Override
	public List<Emp> queryForList() {
		Session session=sqlserverSessionFactory.getCurrentSession();
		Query query=session.createQuery("from Emp");
		return query.list();
	}
	
}
